package org.jeecg.modules.bobo.common.service.impl;

import org.jeecg.modules.bobo.common.entity.LbAutoServiceLog;
import org.jeecg.modules.bobo.common.mapper.LbAutoServiceLogMapper;
import org.jeecg.modules.bobo.common.service.ILbAutoServiceLogService;
import org.jeecg.modules.bobo.common.util.DateUtil;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * @Description: 业务运行日志
 * @Author: jeecg-boot
 * @Date:   2020-11-23
 * @Version: V1.0
 */
@Service
public class LbAutoServiceLogServiceImpl extends ServiceImpl<LbAutoServiceLogMapper, LbAutoServiceLog> implements ILbAutoServiceLogService {
    @Override
    @Async("lbAutoServiceLogServiceAsyncExecutor")
    public void setLog(String logType, String requestParam, String logContent) {
        try {
            LbAutoServiceLog lbAutoServiceLog=new LbAutoServiceLog();
            lbAutoServiceLog.setCreateTime(DateUtil.getDate());
            lbAutoServiceLog.setLogContent(logContent);
            lbAutoServiceLog.setLogType(logType);
            lbAutoServiceLog.setRequestParam(requestParam);
            save(lbAutoServiceLog);
        }catch (Exception e){

        }
    }
    public void setLog(String logType,String logContent) {
        setLog(logType, "", logContent);
    }
}
